package com.summer.filesync.model.manager;

/** 系统健康状态 */
public class SystemHealthStatus {
  private boolean healthy;
  private double diskSpaceUsage;
  private boolean databaseHealth;
  private int duplicateFileCount;
  private int recycleBinSize;
  private String errorMessage;
  private java.time.LocalDateTime checkTime;
  private String overallStatus;

  public SystemHealthStatus() {
    this.checkTime = java.time.LocalDateTime.now();
    this.healthy = true;
  }

  /** 获取整体状态描述 */
  public String getOverallStatus() {
    if (!healthy) {
      return "不健康";
    }

    if (diskSpaceUsage > 90) {
      return "警告 - 磁盘空间不足";
    } else if (diskSpaceUsage > 75) {
      return "注意 - 磁盘空间较高";
    } else if (duplicateFileCount > 100) {
      return "建议 - 重复文件较多";
    } else {
      return "健康";
    }
  }

  // Getters and Setters
  public boolean isHealthy() {
    return healthy;
  }

  public void setHealthy(boolean healthy) {
    this.healthy = healthy;
  }

  public double getDiskSpaceUsage() {
    return diskSpaceUsage;
  }

  public void setDiskSpaceUsage(double diskSpaceUsage) {
    this.diskSpaceUsage = diskSpaceUsage;
  }

  public boolean isDatabaseHealth() {
    return databaseHealth;
  }

  public void setDatabaseHealth(boolean databaseHealth) {
    this.databaseHealth = databaseHealth;
  }

  public int getDuplicateFileCount() {
    return duplicateFileCount;
  }

  public void setDuplicateFileCount(int duplicateFileCount) {
    this.duplicateFileCount = duplicateFileCount;
  }

  public int getRecycleBinSize() {
    return recycleBinSize;
  }

  public void setRecycleBinSize(int recycleBinSize) {
    this.recycleBinSize = recycleBinSize;
  }

  public String getErrorMessage() {
    return errorMessage;
  }

  public void setErrorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
  }

  public java.time.LocalDateTime getCheckTime() {
    return checkTime;
  }

  public void setCheckTime(java.time.LocalDateTime checkTime) {
    this.checkTime = checkTime;
  }
}
